<template>
  <div id="userCheckDialog">
    <el-dialog
      :title="`审核${dialogData.type === 'notPass' ? '不' : ''}通过`"
      :visible.sync="dialogData.isShow"
      width="430px"
      :before-close="labelHandleClose"
    >
      <!-- <dl>
        <dd><label>昵称</label>：{{ dialogData.params.loginName }}</dd>
        <dd><label>大鹏号</label>：{{ dialogData.params.dpAccount }}</dd>
      </dl>-->
      <div class="instruction">
        {{ dialogData.type === 'pass' ? passText : notPassText }}
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button plain @click="cancelLabel">取 消</el-button>
        <el-button type="success" :loading="loading" @click="confirmDel"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  name: 'userCheckDialog',
  msg: '用户信息修改审核-删除',
  props: ['dialogData'],
  data() {
    return {
      loading: false,
      passText: '是否通过该用户修改的个人信息？',
      notPassText: '不通过该用户修改的个人信息？'
    }
  },
  methods: {
    labelHandleClose(done) {
      this.cancelLabel()
      done()
    },
    cancelLabel() {
      // 关闭前清空
      this.dialogData.params = ''
      this.dialogData.type = ''
      this.dialogData.isShow = false
    },
    confirmDel() {
      if (this.dialogData.type === 'pass') {
        this.$emit('passRequest', this.dialogData.params)
      } else {
        this.$emit('failRequest', this.dialogData.params)
      }
      this.cancelLabel()
    }
  }
}
</script>
<style lang="less">
#userCheckDialog {
  .el-dialog .el-dialog__body {
    padding-top: 10px !important;
  }
  dl {
    line-height: 26px;
    label {
      display: inline-block;
      width: 50px;
      text-align-last: justify;
    }
  }
  .instruction {
    font-size: 14px;
    color: #333;
    padding: 20px 0 40px;
    text-align: center;
  }
}
</style>
